<?php

if (validation_errors()) :
?>
<section class="content-header">
<div class='alert alert-block alert-error fade in'>
    <a class='close' data-dismiss='alert'>&times;</a>
    <h4 class='alert-heading'>
        <?php echo lang('buildings_errors_message'); ?>
    </h4>
    <?php echo validation_errors(); ?>
</div>
</section>
<?php
endif;

$id = isset($buildings->id) ? $buildings->id : '';

?>


<section class="content-header">
    <h1>
                添加文章
    </h1>
</section>
<section class="content">
<style type="text/css">
    .form-group-m-b{margin-bottom: 15px;}
    em{display: block;height: 15px;}
    .form1_col .col-xs-2{padding-right: 0;}
    .checkbox-1{margin-top:25px ;}
    .thumbnail-lp{width: 100%;border: 1px solid #DFDFDF; position: relative;}
    .thumbnail-lp img,.lp-pic img,.door_pic img{width: 100%;margin: 0 auto;}
    .lp-pic{width: 100%;border: 1px solid #DFDFDF;min-height: 250px;position: relative;}
    .lp-pic .form-control{width: 90%; margin: 10px auto;}
    .door_pic{width: 49%;border: 1px solid #DFDFDF; min-height: 200px;position: relative;}
    .lptype{display: none;}
    .addpicbg{cursor: pointer;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);-webkit-transform:  translate(-50%,-50%);}
    .pic_delete{position: absolute;right: 10px; top: 10px;display: none;}
    .text-danger:hover{color: #dd4b39;}
    .picbg-parent{position: relative;height: 200px;}
</style>
<script>
        var  id_pc_arr = "";
        var  id_mobile_arr = "";
</script>
  <div class="row">
    <!-- form start -->
<!--     <?php //echo form_open($this->uri->uri_string(), 'class="form-horizontal" onkeydown="if(event.keyCode==13){return false;}"'); ?> -->
    <div class="col-md-9">
	        <div class="box-body" style="padding: 0;">
	            <div class="clearfix">
                    <input id='title'  class="form-control" placeholder="在此输入标题" style="font-size: 18px;"/>
                    <input id='project'  class="form-control" placeholder="所属项目名称" style="font-size: 18px;margin-top: 15px;"/>
                    <input id='building_code'  class="form-control" placeholder="项目编码" style="font-size: 18px;margin-top: 15px;"/>
		        <div class="col-lg-12 editor_hide" style="padding: 0;">
					<textarea id="editor1" name="editor1" class="editor1" style="padding: 0;"></textarea>
			</div>

		        </div>
	        </div>
			<em></em>
			 <!--特色图片beg-->
			<div class="box box-danger feature_pic" style="display: none;">
	            <div class="box-header with-border">
	              <h3 class="box-title">特色图片</h3>
	              <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
              		<i class="fa fa-minus"></i>
                  </button>
	            </div>
                    <div class="box-body">

                              <div class="clearfix">
                                  <div class="pull-left door_pic text-center" id="container_info_pc">
                                          <div class="picbg-parent info_pc">
                                            <div class="addpicbg" id="pc_info_pickfiles">
                                                               <span class="fa fa-file-image-o" style="font-size: 40px;color: #a94442;"></span><br /><br />
                                                               <span class="text-danger">添加特色照片（Large）</span>
                                                         </div>
                                          </div>
                                  </div>
                                  <div class="pull-right door_pic text-center" id="container_info_mobile">
                                    <div class="picbg-parent info_mobile" >
                                      <div class="addpicbg" id="mobile_info_pickfiles">
                                          <span class="fa fa-file-image-o" style="font-size: 40px;color: #a94442;"></span><br /><br />
                                          <span class="text-danger">添加特色照片（Small）</span>
                                      </div>
                                    </div>  
                                  </div>
                              </div>
                    </div>
                <!-- /.box-body -->
	              <!-- /.box-body -->
	          </div>
	          <!--特色图片end-->
	           <!--链接beg-->
			<div class="box box-danger words_href" style="display: none;">
	            <div class="box-header with-border">
	              <h3 class="box-title">链接</h3>
	              <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
              		<i class="fa fa-minus"></i>
                  </button>
	            </div>
	            <!-- /.box-header -->
	            <div class="box-body">
                    <input  class="form-control" id="target_link" placeholder="请输入链接" />   
	            </div>
	              <!-- /.box-body -->
	          </div>
	          <!--链接end-->
	           <!--工具条beg-->
		<div class="box box-danger">
	            <div class="box-header with-border">
	              <h3 class="box-title">工具条</h3>
	              <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
              		<i class="fa fa-minus"></i>
                  </button>
	            </div>
	            <!-- /.box-header -->
	            <div class="box-body">
                    <div class="clearfix">
                        <label class="checkbox-inline">
						  <input type="checkbox" id="show-phone" class="minimal" value="1"> 显示电话
						</label>
						<label class="checkbox-inline">
						  <input type="checkbox" id="show-yuyue" class="minimal" value="1"> 显示预约看房
						</label>
						<label class="checkbox-inline">
						  <input type="checkbox" id="show-hx" class="minimal" value="1"> 显示户型
						</label>
                    </div>
	            </div>
	              <!-- /.box-body -->
	          </div>
	          <!--工具条end-->
            <!--录入号码beg-->

              <div class="box box-danger ext-set">
                  <div class="box-header with-border">
                    <h3 class="box-title">分机号设置</h3>
                    <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
                      <i class="fa fa-minus"></i>
                      </button>
                  </div>
                  <!-- /.box-header -->
                  <div class="box-body">
                        <div class="col-sm-2">
                          <select class="form-control select2" style="width: 100%;" name="plat[]">
                            <option value="1">PC端</option>
                            <option value="2">手机端</option>
                          </select>
                        </div>
                      <div class="col-sm-4">
                          <select class="form-control select2 tmp" style="width: 100%;" name="channel_id[]">
                            <?php foreach ($channels as $channel) : ?>
                            <option value="<?php echo $channel->id; ?>"><?php echo $channel->name; ?></option>
                            <?php endforeach; ?>
                          </select>
                      </div>
                      <div class="col-sm-4" style="padding-right: 0px;">
                          <input type='text' name="number[]" maxlength='25' class="form-control" value="<?php echo set_value('number', isset($phone->number) ? $phone->number : ''); ?>" placeholder="分机号/400号码" style="font-size: 18px;" />
                      </div>  
                      <a style="margin-left:20px" href="javascript:;" class="add-channel">增加</a>
                      <a style="margin-left:20px" href="javascript:;" class="del-channel">删除</a>
                  </div>                
                    <!-- /.box-body -->
            </div>
            <!--录入号码end-->

        </div>

        <div class="col-md-3">
		<!--发布beg-->
		<div class="box box-danger">
            <div class="box-body form-horizontal">
                <div class="box-body">
               		<button type="1" action="1"   id="sub" name='save' class="col-xs-6 btn btn-danger btn-lg">发布</button>
               		<button type="button" class="col-xs-4 btn btn-default btn-lg" style="margin-left: 10px;">预览</button>
                </div>
           		<div class="box-body">状态：<span>已发布</span></div>
           		<div class="clearfix">
           			<div class="col-xs-5">
           			<select class="form-control" id="status">
						<option value="2">已发布</option>
					  	<option value="4">等待复审</option>
					  	<option value="1">草稿</option>
					</select>
           		</div>
           		<div class="col-xs-7" style="margin-left: -20px;">
           			<button type="1" action="2" id="sub" class="col-xs-6 btn btn-danger">确定</button>
           			<button type="button" class="col-xs-5 btn btn-default pull-right">取消</button>
           		</div>
           		</div>
           		<em></em>
           		<em></em>
           		<em></em>
           		<div class="box-body">发布于：2016年3月2日 @ 15:12</div>
              </div>
              <!-- /.box-body -->
         </div>
		<!--发布end-->	
		<!--缩略图beg-->
        <div class="box box-danger">
            <div class="box-header with-border">
                <h3 class="box-title">缩略图</h3>
                <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
              		<i class="fa fa-minus"></i>
                </button>
            </div>
            <div class="box-body" id="container">
                <div class="thumbnail-lp pic_parent campaign_pic">
                	<!-- <img src="<?php //echo Template::theme_url('images/photo1.png'); ?>"/> -->
                	<!-- <button class="btn btn-default btn-sm pic_delete">删除</button> -->
                </div>
                <em></em>
                <a href="#" id="source_pic">添加缩略图</a>
            </div>
        </div>
        <!--缩略图end-->
        <!--文章分类end-->    
        <div class="box box-danger">
            <div class="box-header with-border">
              <h3 class="box-title">文章分类</h3>
              <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
              		<i class="fa fa-minus"></i>
              </button>
            </div>
            <!-- /.box-header -->
              <div class="box-body form-horizontal">
              <?php if(isset($categories) && !empty($categories)) : ?>
                  <?php foreach ($categories as $category) : ?>
                    <div class="form-group">
                        <div class="col-sm-12">
                            <input type="checkbox" class="minimal" name="category[]" value="<?php echo $category->tag_id; ?>" id="category_<?php echo $category->tag_id; ?>" />
                            <?php echo form_label($category->tag_name, 'category_'.$category->tag_id, array()); ?>
                        </div>
                    </div>
                  <?php endforeach; ?>
          <?php endif;?>
                 <a href="javascript:;" class="add-lptype">+ 添加新闻类型</a>
                <div class="lptype">
                    <em></em>
                    <div class="form-group col-sm-12">
                        <input id='add_news_type' type='text' name='add_news_type' maxlength='100' class="form-control" value=""  />
                    </div>
                    <button action="1" class="add_new_cate" class="btn btn-danger">添加新闻类型</button>
                </div>
              </div>
              <!-- /.box-body -->
          </div>    
         <!--文章分类end-->   
        <!--类型beg-->    
        <div class="box box-danger">
            <div class="box-header with-border">
              <h3 class="box-title">类型</h3>
              <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
              		<i class="fa fa-minus"></i>
              </button>
            </div>
            <!-- /.box-header -->
              <div class="box-body form-horizontal">
                <div class="form-group">
                    <div class="col-sm-12">
                        <div class="radio">
							<label>
							    <input type="radio" name="optionsRadios" class="radioItem"  value="1" checked="checked">普通
							</label>
						</div>
						<div class="radio">
							<label>
							    <input type="radio" name="optionsRadios" class="radioItem" value="2">图片
							</label>
						</div>
						<div class="radio">
							<label>
							    <input type="radio" name="optionsRadios" class="radioItem" value="3">链接
							</label>
						</div>
                    </div>
                </div>
              </div>
              <!-- /.box-body -->
          </div>    
        <!--类型end-->
        <!--标签beg-->
           <div class="box box-danger">
            <div class="box-header with-border">
              <h3 class="box-title">标签</h3>
              <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
                    <i class="fa fa-minus"></i>
              </button>
            </div>
            <!-- /.box-header -->
              <div class="box-body form-horizontal add-news-tag">
                <div class="form-group">
                    <div class="col-sm-9">
                                   <select class="form-control" style="width: 100%;" name="tags[]" id="add_tag_name" multiple="multiple">
                                          <option value=""></option>
                                  </select>
                    </div>
                    <button action="2" id="add_tag" class="btn btn-danger add_new_cate">添加</button>
                </div>
                <a href="javascript:;">从常用标签中选择</a>
                </div>
                
              </div>
              <!-- /.box-body -->
          </div>
          <!--标签end-->
            <!-- /.box-header -->
              <div class="box-body form-horizontal">
                <div class="form-group">
                	
                    <div class="col-sm-12">
                        <img src="<?php echo Template::theme_url('images/avatar5.png'); ?>" id="building_thumb_img" style="width: 100%; display: none;" />
                        <input type="hidden" name="building_thumb_url" id="building_thumb_url" value="" style="display:none;" />
                    </div>
                </div>
                
              </div>
              <!-- /.box-body -->
          </div>
</section>